package com.xnx.bincker.leader.exception.data.datasource;

import com.xnx.bincker.leader.exception.data.DataException;

/**
 * 数据不存在异常
 */
public class DataNotExistsException extends DataException {
    private static final int CODE = 10;

    public DataNotExistsException() {
        this("数据已被删除或不存在");
    }

    public DataNotExistsException(String message) {
        this(message, message);
    }

    public DataNotExistsException(String message, String tip) {
        this(message, tip, null);
    }

    public DataNotExistsException(String message, String tip, Throwable cause) {
        this(0, message, tip, cause);
    }

    protected DataNotExistsException(int code, String message, String tip, Throwable cause){
        super(CODE + code, message, tip, cause);
        assert code < 10;
    }
}
